
public class Point {
	private double X;
	private double Y;
	/**
	 * constructor for Point
	 * @param x the X coordinate for the Point
	 * @param y the Y coordinate for the Point
	 */
	public Point(double x, double y)
	{
		this.X=x;
		this.Y=y;
	}
	/**
	 * a copy constructor for Point utilizing deep copy semantics.
	 * @param other an instance of point, must be initialized.
	 */
	public Point(Point other) 
	{
		if (other == null)
			throw new RuntimeException("input object uninitialized");
		this.X=other.getX();
		this.Y=other.getY();
	}
	/**
	 * a getter for the X coordinate of a point.
	 * @return the X coordinate.
	 */
	public double getX() 
	{
		return this.X;
	}
	/**
	 * a getter for the Y coordinate of a point.
	 * @return the Y coordinate.
	 */
	public double getY()
	{
		return this.Y;
	}
	/**
	 * move a point by a given amount
	 * @param x the amount to be added to the X coordinate.
	 * @param y the amount to be added to the Y coordinate.
	 */
	public void move(int x, int y) 
	{
		this.X=this.X+x;
		this.Y=this.Y+y;
	}
	/**
	 * move a point by adding another point's coordinates to it
	 * @param p an instance of Point, must be initialized.
	 */
	public void move(Point p)
	{
		this.X=this.X+p.getX();
		this.Y=this.Y+p.getY();
	}
	/**
	 * a logical comperison of two points
	 * @param other the object to be compared.
	 * @return true if the object is an instance of Point and the both coordinates are equal
	 */
	public boolean equals(Object other)
	{
		if(other == null)
			throw new RuntimeException("input object uninitialized");
		if(other instanceof Point)
			return (this.X==((Point)other).getX() && this.Y==((Point)other).getY());
		else
			return false;
	}
	/**
	 * calculates the distance between two points
	 * @param p the point to be compared to for distance calculation.
	 * @return the length of the direct line between the input point and the current instance of point
	 */
	public double distance(Point p)
	{
		return Math.sqrt(Math.pow(this.X-p.getX(),2)+Math.pow(this.Y-p.getY(),2));
	}

}
